<?php

namespace app\modules\admin\controllers;

use Yii;

use yii\helpers\Url;
use yii\web\Controller;


class BaseController extends Controller
{
    public function beforeAction($action){
        if(Yii::$app->user->isGuest && Yii::$app->controller->action->id != 'login'){
            $this->redirect(Url::toRoute(Yii::$app->params['loginUrl']));
        }
        return parent::beforeAction($action);
    }
}

   
